package com.java.comprehensive.arithmetic.leecode.easy;

import java.util.*;

/**
 * @Author 窦绍飞
 * @create 2022/9/16
 */
public class LeetCode_449 {

	public static List<Integer> findDisappearedNumbers(int[] nums) {
		int n = nums.length;
		Set<Integer> map = new HashSet<>();
		for (int i = 1; i <= n; i++) {
			map.add(i);
		}
		for (int num : nums) {
			map.remove(num);
		}
		return new ArrayList<>(map);
	}

	public static void main(String[] args) {
		int[] nums = { 4, 3, 2, 7, 8, 2, 3, 1 };
		System.out.println(findDisappearedNumbers(nums));
	}
}
